package com.cam.generator.web;

import com.cam.framework.utils.RestResult;
import com.cam.generator.service.VelocityTestService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test/velocity")
public class VelocityTestController {

    private final VelocityTestService velocityTestService;

    public VelocityTestController(VelocityTestService velocityTestService) {
        this.velocityTestService = velocityTestService;
    }

    @GetMapping("/testString")
    public RestResult testString() {
        String testString = velocityTestService.renderTestTemplate();
        return RestResult.success().put("template", testString);
    }
}
